package com.ql.mangersystem.exception;

import com.ql.mangersystem.common.ErrorCode;
import lombok.Getter;

@Getter
public class ServiceException extends RuntimeException {

    private final Integer code;
    private final String msg;


    public ServiceException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
    public ServiceException(ErrorCode errorCode) {
        super(errorCode.getMsg());
        this.code = errorCode.getCode();
        this.msg = errorCode.getMsg();
    }
}
